import { tfGet, yfuPost } from '@/utils/request'

export function getRoleList (param, then1, error1) {
  tfGet('/static/roleList.json', then1, error1)
}

export function addRole (param, then1, error1) {
  yfuPost(process.env.BASE_API, '/role/addRole', param, then1, error1)
}

export function updateRole (param, then1, error1) {
  yfuPost(process.env.BASE_API, '/role/updateRole', param, then1, error1)
}

export function addRoleUser (param, then1, error1) {
  yfuPost(process.env.BASE_API, '/userRole/addRoleUser', param, then1, error1)
}

export function deleteRoleUser (param, then1, error1) {
  yfuPost(process.env.BASE_API, '/userRole/deleteRoleUser', param, then1, error1)
}

export let getRoleById = {
  name: '根据ID得到对应的组织',
  url: '/static/oneRole.json',
  functionName: 'getRoleById'
}

export let getRoleUserList = {
  name: '得到对应的角色的所有人员',
  url: '/userRole/getRoleUserList',
  functionName: 'getRoleUserList'
}

export let getRoleListRemote = {
  name: '服务端得到所有的角色信息',
  url: '/role/getRoleList',
  functionName: 'getRoleList'
}

export let deleteRoleRemote = {
  name: '服务端删除角色信息',
  url: '/role/deleteRoles',
  functionName: 'deleteRoles'
}
